<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>浏览器识别</title>
    <style>.active{color:red}</style>
<body>
    <h1>我是H1</h1>
    
    <script> 
    var ua = navigator.userAgent; //浏览器头信息
    document.getElementsByTagName("h1")[0].innerHTML = ua;

    </script>

</body>
</html>